/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;

import javax.swing.JButton;

/**
 *
 * @author RoKe
 */
public class HealthDisplay extends javax.swing.JPanel {

    /**
     * Creates new form HealthDisplay
     */
    public HealthDisplay(int maxHealth) {
        initComponents();
        jpbLeftPlayer.setValue(maxHealth);
        jpbRightPlayer.setValue(maxHealth);
        jpbLeftPlayer.setMaximum(maxHealth);
        jpbRightPlayer.setMaximum(maxHealth);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jpbLeftPlayer = new javax.swing.JProgressBar();
        jPanel2 = new javax.swing.JPanel();
        jpbRightPlayer = new javax.swing.JProgressBar();

        setLayout(new java.awt.GridLayout(1, 0));

        jPanel1.setLayout(new java.awt.BorderLayout());

        jpbLeftPlayer.setBackground(new java.awt.Color(204, 255, 102));
        jpbLeftPlayer.setForeground(new java.awt.Color(255, 0, 0));
        jpbLeftPlayer.setToolTipText("");
        jPanel1.add(jpbLeftPlayer, java.awt.BorderLayout.CENTER);

        add(jPanel1);

        jPanel2.setLayout(new java.awt.BorderLayout());
        jPanel2.add(jpbRightPlayer, java.awt.BorderLayout.CENTER);

        add(jPanel2);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JProgressBar jpbLeftPlayer;
    private javax.swing.JProgressBar jpbRightPlayer;
    // End of variables declaration//GEN-END:variables

    public void updateHealth(int healthL, int healthR) {
    jpbLeftPlayer.setValue(healthL);
    jpbRightPlayer.setValue(healthR);
    
    }
}
